cmake_minimum_required(VERSION 3.3)

#[[基本头文件]]
set(base_head
        Timestamp.h
        FileUtils.h
        log/LogStream.h
        log/Logging.h
        log/LogFile.h
        log/AsyncLogging.h
        noncopyable.h
        copyable.h
        Atomic.h
        Types.h
        thread/CountDownLatch.h
        thread/CurrentThread.h
        thread/Mutex.h
        thread/Thread.h
        thread/ThreadPool.h
        json/JsonUtils.h
        Endian.h
        ByteArray.h
        )

#[[基本头文件实现类]]
set(LIBBASE_SRC
        thread/Mutex.cpp
        Timestamp.cpp
        FileUtils.cpp
        log/LogStream.cpp
        log/Logging.cpp
        log/LogFile.cpp
        log/AsyncLogging.cpp
        thread/CountDownLatch.cpp
        thread/CurrentThread.cpp
        thread/Thread.cpp
        thread/ThreadPool.cpp
        json/JsonUtils.cpp
        ByteArray.cpp
        )

add_library(base SHARED ${LIBBASE_SRC})

link_libraries(libjsoncpp.a)
target_link_libraries(base libjsoncpp.a)

install(FILES ${base_head} DESTINATION include/myMuduo/base)
install(TARGETS base DESTINATION lib)